package com.EAIPClub.ResourcesInfoManager.controller;

import com.EAIPClub.ResourcesInfoManager.service.ResourcesInfoManagerFileUserInfoService;
import com.api.POJO.ResourcesInfoManager.ResourcesInfoManagerReturnMsg;
import com.api.POJO.ResourcesInfoManager.ResourcesInfoManagerUserFileInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description :
 * @Author :
 * @Date : 2021/11/2
 */
@RestController
@RequestMapping("/res/fileuserinfo")
@Api
public class ResourcesInfoManagerFileUserInfoController {

    private ResourcesInfoManagerFileUserInfoService service;
    @Autowired
    public void setService(ResourcesInfoManagerFileUserInfoService service) {
        this.service = service;
    }

    @PostMapping("/add")
    @ApiOperation(value = "新增静态资源用户文件信息",produces = "application/json")
    ResourcesInfoManagerReturnMsg addNewFileUserInfo(@RequestBody ResourcesInfoManagerUserFileInfo userFileInfo){
        return service.addNewFileUserInfo(userFileInfo);
    }

    @GetMapping("/get/fuid/{fuid}")
    @ApiOperation(value = "通过fuid查找静态资源用户文件信息",produces = "application/json")
    ResourcesInfoManagerReturnMsg getFileUserInfoByFuid(@PathVariable String fuid){
        return service.getFileUserInfoByFuid(fuid);
    }
    @GetMapping("/get/uuid/{uuid}")
    @ApiOperation(value = "通过uuid查找静态资源用户文件信息",produces = "application/json")
    ResourcesInfoManagerReturnMsg getFileUserInfoByUuid(@PathVariable String uuid){
        return service.getFileUserInfoByUuid(uuid);
    }

    @PutMapping("/update/fuid/{fuid}")
    @ApiOperation(value = "通过fuid更新静态资源用户文件信息",produces = "application/json")
    ResourcesInfoManagerReturnMsg updateFileUserInfoByFuid(@PathVariable String fuid,@RequestBody ResourcesInfoManagerUserFileInfo userFileInfo){
        return service.updateFileUserInfoByFuid(fuid,userFileInfo);
    }
    @PutMapping("/update/uuid/{uuid}")
    @ApiOperation(value = "通过uuid更新静态资源用户文件信息",produces = "application/json")
    ResourcesInfoManagerReturnMsg updateFileUserInfoByUuid(@PathVariable String uuid,@RequestBody ResourcesInfoManagerUserFileInfo userFileInfo){
        return service.updateFileUserInfoByUuid(uuid,userFileInfo);
    }

    @DeleteMapping("/delete/fuid/{fuid}")
    @ApiOperation(value = "通过fuid删除静态资源用户文件信息",produces = "application/json")
    ResourcesInfoManagerReturnMsg deleteFileUserInfoByFuid(@PathVariable String fuid){
        return service.deleteFileUserInfoByFuid(fuid);
    }
    @DeleteMapping("/delete/uuid/{uuid}")
    @ApiOperation(value = "通过uuid删除静态资源用户文件信息",produces = "application/json")
    ResourcesInfoManagerReturnMsg deleteFileUserInfoByUuid(@PathVariable String uuid){
        return service.deleteFileUserInfoByUuid(uuid);
    }
}
